package structuralModel.combinationModel;

import java.util.Map;

public class combinationModelClient {

    public static void main(String[] args){
        // 学校
        CombinationCompoent university = new University("清华大学","清华大学");

        // 院系
        CombinationCompoent computerCollege = new College("计算机学院","计算机学院");
        CombinationCompoent departmentCollege = new College("土木工程学院","土木工程学院");

        university.addElement(computerCollege);
        university.addElement(departmentCollege);

        // 系
        CombinationCompoent computerDepartment1 = new Department("计算机科学与技术","计算机科学与技术");
        CombinationCompoent computerDepartment2 = new Department("计算机应用与技术","计算机应用与技术");
        computerCollege.addElement(computerDepartment1);
        computerCollege.addElement(computerDepartment2);

        CombinationCompoent departmentDepartment1 = new Department("工程造价1","工程造价1");
        CombinationCompoent departmentDepartment2 = new Department("工程造价2","工程造价2");
        departmentCollege.addElement(departmentDepartment1);
        departmentCollege.addElement(departmentDepartment2);

        System.out.println("+++++++++大学信息");
        university.queryAll();

        System.out.println("+++++++++学院信息");
        computerCollege.queryAll();
        departmentCollege.queryAll();

        System.out.println("+++++++++系信息");
        computerDepartment1.queryAll();
        departmentDepartment1.queryAll();

        // 组合模式 在jdk 源码中额应用
        Map<String, CombinationCompoent> map = null;
    }
}
